package com.java.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 报价单信息
 * @author Administrator
 *
 */
@Entity
@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true, 
		dynamicInsert = true, 
		dynamicUpdate = true
)
@Table(name="qindex")
public class QIndex implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	private Long id;
	
	/**
	 * 报价单号
	 * 业务员代码+YYYYMMDD+顺序号
	 */
	@Column(length=100)
	private String qid;
	
	/**
	 * 创建日期
	 */
	@Temporal(TemporalType.TIMESTAMP)	
	private Date qDate;

	/**
	 * 产品列表
	 */	
	@OneToMany(mappedBy="qid",cascade=CascadeType.REMOVE)
	private List<QList> qlist = new ArrayList<QList>();
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getQid() {
		return qid;
	}

	public void setQid(String qid) {
		this.qid = qid;
	}

	public Date getqDate() {
		return qDate;
	}

	public void setqDate(Date qDate) {
		this.qDate = qDate;
	}

	public List<QList> getQlist() {
		return qlist;
	}

	public void setQlist(List<QList> qlist) {
		this.qlist = qlist;
	}
		
}
